package com.drug.wms.service.impl;

import java.util.List;

import com.drug.common.utils.DateUtils;
import com.drug.wms.domain.BusManufacturerInfo;
import com.drug.wms.mapper.BusManufacturerInfoMapper;
import com.drug.wms.service.IBusManufacturerInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 生产厂商Service业务层处理
 *
 * @author ruoyi
 * @date 2021-11-06
 */
@Service
public class BusManufacturerInfoServiceImpl implements IBusManufacturerInfoService {
    @Autowired
    private BusManufacturerInfoMapper busManufacturerInfoMapper;

    /**
     * 查询生产厂商
     *
     * @param id 生产厂商主键
     * @return 生产厂商
     */
    @Override
    public BusManufacturerInfo selectBusManufacturerInfoById(String id) {
        return busManufacturerInfoMapper.selectBusManufacturerInfoById(id);
    }

    /**
     * 查询生产厂商列表
     *
     * @param busManufacturerInfo 生产厂商
     * @return 生产厂商
     */
    @Override
    public List<BusManufacturerInfo> selectBusManufacturerInfoList(BusManufacturerInfo busManufacturerInfo) {
        return busManufacturerInfoMapper.selectBusManufacturerInfoList(busManufacturerInfo);
    }

    /**
     * 新增生产厂商
     *
     * @param busManufacturerInfo 生产厂商
     * @return 结果
     */
    @Override
    public int insertBusManufacturerInfo(BusManufacturerInfo busManufacturerInfo) {
        busManufacturerInfo.setCreateTime(DateUtils.getNowDate());
        return busManufacturerInfoMapper.insertBusManufacturerInfo(busManufacturerInfo);
    }

    /**
     * 修改生产厂商
     *
     * @param busManufacturerInfo 生产厂商
     * @return 结果
     */
    @Override
    public int updateBusManufacturerInfo(BusManufacturerInfo busManufacturerInfo) {
        busManufacturerInfo.setUpdateTime(DateUtils.getNowDate());
        return busManufacturerInfoMapper.updateBusManufacturerInfo(busManufacturerInfo);
    }

    /**
     * 批量删除生产厂商
     *
     * @param ids 需要删除的生产厂商主键
     * @return 结果
     */
    @Override
    public int deleteBusManufacturerInfoByIds(String[] ids) {
        return busManufacturerInfoMapper.deleteBusManufacturerInfoByIds(ids);
    }

    /**
     * 删除生产厂商信息
     *
     * @param id 生产厂商主键
     * @return 结果
     */
    @Override
    public int deleteBusManufacturerInfoById(String id) {
        return busManufacturerInfoMapper.deleteBusManufacturerInfoById(id);
    }
}
